package ch8;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        int[] num = new int[3];
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入第"+1+"个数");
        num[0]=scan.nextInt();
        int min=num[0];
        int count=0;
        for (int i = 0; i < num.length-1; i++) {
            System.out.println("请输入第"+(i+2)+"个数");
            num[i]=scan.nextInt();
            if(num[i]<min) {
                min = num[i];
                count=i+1;
            }
        }
        System.out.println("最小的值为"+min);
        System.out.println("它的位置是"+count);
    }
}